class Player(object):
    def __init__(self, name,age,city): #初始化函数
        self.name = name
        self.age = age
        self.city = city

jj = Player("林俊杰",30,"新加坡")
print(jj.name, jj.age, jj.city)

# 修改属性
jj.city = "杭州"
print(jj.city)

jj.height = 180
# 获取实例(对象)的所有属性
print(jj.__dict__)

# jay = Player()
# jay.name = "周杰伦"
# jay.age = 24
# jay.city = '成都'
# print(jay.name,jay.age,jay.city)

class Weapon(object):
    def __init__(self,name,damage,level):
        self.name = name
        self.damage = damage
        self.level = level
gun = Weapon('magic',1000,3)
print(gun.__dict__)
